<template>
  <div>
    <el-form label-position="top" label-width="80px" :model="formLabelAlign">
      <el-form-item label="价格（USDT）">
        <el-input v-model="formLabelAlign.name"></el-input>
      </el-form-item>
      <el-form-item label="金额（USDT）">
        <el-input v-model="formLabelAlign.type"></el-input>
      </el-form-item>
      <el-form-item label="数量（ETH）">
        <el-input v-model="formLabelAlign.region" placeholder="最小交易数量是0.0001ETH" :disabled="true"></el-input>
      </el-form-item>
    </el-form>
    <span style="font-size: 5px">可用：{{ usdtBalance }} USDT</span>
    <br>
    <span style="font-size: 5px"> {{ type=='buy' ? '可买' :'可卖'}}：0.00 ETH</span>

    <el-button :type="type=='buy' ? 'primary' : 'danger'" class="button" style="display:block;margin:0 auto">
      {{ type=='buy' ? '买入' :'卖出'}}
    </el-button>
  </div>
</template>

<script>
  import {getUsdtBalance} from '@/api/modules/platformAccount'

  export default {
    name: "DealAsideForm",
    props: ['type'],
    data() {
      return {
        formLabelAlign: {
          name: '',
          region: '',
          type: '',
          usdtBalance: ''
        }
      }
    },
    created() {
      this.getUsdtBalance()
    },
    methods: {
      getUsdtBalance() {
        debugger
        getUsdtBalance().then(res => {
          console.log("getUsdtBalance", res.data[0].available)
          this.usdtBalance = res.data[0].available
        })
      }
    }
  }
</script>

<style scoped>

  .button {
    /*width: 200px*/
  }
</style>
